count the number of words in the file